<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8" />
    <title>变量赋值</title>
    <script>
        /*
         变量赋值
         1.先定义后赋值
         var age;
         age = 18;       
 
         2.定义时赋值
         var age = 18;
 
         3.同时声明多个变量,随后分别进行赋值
         var name,age;
         name = "张三";
         age = 18;
 
         4.同时声明多个变量，并同时赋值
         var name="张三",age=18;
         var name = 'zs', age;  // 这时 age 是 undefined
        */

        /* var age;
        age = 18;
        console.log(age);
        age = 20;
        console.log(age); */

        /* var age = 18;
        console.log(age); */

        /* var name, age;
        name = "张三";
        age = 18;

        console.log(name);
        console.log(age); */

        var name = "张三", age = 18;
        console.log(name);
        console.log(age);


    </script>
</head>

<body>
</body>

</html>